home *** CD-ROM | disk | FTP | other *** search
/ CD Classic 39 / CD CLASSIC #39 (1998).iso / EMPRESA / visio / Vistdstd / Install / Data.Z / VB Event Sample.CLS < prev    next >
Text File  |  1996-08-02  |  2KB  |  60 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "EventSink"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. ' -------------------------------------------------------------------------
  9. ' Copyright (C) 1996 Visio Corporation
  10. '
  11. ' You have a royalty-free right to use, modify, reproduce and distribute
  12. ' the Sample Application Files (and/or any modified version) in any way
  13. ' you find useful, provided that you agree that Visio has no warranty,
  14. ' obligations or liability for any Sample Application Files.
  15. ' -------------------------------------------------------------------------
  16.  
  17. Option Explicit
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. ' VisEventProc - Handles Visio event notifications
  25. '
  26. ' Parameters:
  27. '   eventCode      = Event ID.
  28. '   sourceObj   = Reference to the source object of the event.
  29. '   eventID         = The ID of the event in the EventList of the source object.
  30. '   seqNum   = Event sequence ID for this instance of Visio.
  31. '   subjectObj  = A reference to the "subject" object of this event.
  32. '   moreInfo       = Command line string, used for Run Addon Event.
  33. '
  34. Public Sub VisEventProc(eventCode As Integer, sourceObj As Object, eventID As Long, _
  35.                         seqNum As Long, subjectObj As Object, moreInfo As Variant)
  36.  
  37. Dim strDumpMsg As String
  38.     
  39.     ' Find out which event fired.
  40.     Select Case eventCode
  41.         Case visEvtCodeDocSave
  42.             strDumpMsg = "Save(" & eventCode & ")"
  43.             
  44.         Case (visEvtPage + visEvtAdd)
  45.             strDumpMsg = "Page Add(" & eventCode & ")"
  46.             
  47.         Case visEvtCodeShapeDelete
  48.             strDumpMsg = "Shape Deleted(" & eventCode & ")"
  49.             
  50.         Case Else
  51.             strDumpMsg = "Other(" & eventCode & ")"
  52.    End Select
  53.    
  54.    ' Display the event name and code
  55.    UserForm1.TextBox1.Text = strDumpMsg
  56.           
  57. End Sub
  58.  
  59.  
  60.